/*
 * ThreadDriveSequence.h
 *
 *  Created on: Jan 30, 2013
 *      Author: Drew Prevost
 */

#ifndef THREADDRIVESEQUENCE_H_
#define THREADDRIVESEQUENCE_H_

#include <Protothread.h>
#include "ThreadServoRate.h"
#include "ThreadMotorController.h"
#include "Tachometer.h"

class ThreadDriveSequence: public Protothread
{
public:
  ThreadDriveSequence(
                       int nIrqNum,
                       int nPin,
                       int nMode,
                       int nMotorPin,
                       int nSpeedMotorLow,
                       int nSpeedMototHigh,
                       int nAccPerSecondLow,
                       int nAccPerSecondHigh,
                       int nCluthPin,
                       int nDegClutchDown,
                       int nDegClutchUp,
                       int nRateClutchDown,
                       int nRateClutchUp,
                       int nLoadWheelMinRpm,
                       int nSecondsIdle,
                       int nSecondsFullThrottle );

  virtual ~ThreadDriveSequence();

  virtual bool run();

protected:
  ThreadServoRate threadServoRate;
  ThreadMotorController threadMotorController;
  Tachometer tachometer;

  int nMotorPin;
  int nSpeedMotorLow;
  int nSpeedMototHigh;
  int nAccPerSecondLow;
  int nAccPerSecondHigh;

  int nCluthPin;
  int nDegClutchDown;
  int nDegClutchUp;
  int nRateClutchDown;
  int nRateClutchUp;

  int nLoadWheelMinRpm;

  int nSecondsIdle;
  int nSecondsFullThrottle;
};

#endif /* THREADDRIVESEQUENCE_H_ */
